package com.sunfeng.commonlib.receiver;

import android.content.BroadcastReceiver;
import android.content.Context;
import android.content.Intent;
import com.sunfeng.commonlib.message.CommonMessage;
import com.sunfeng.commonlib.message.CommonMessageManager;

/**
 * 解锁屏 receiver
 * Created by wutiaorong on 2017/10/19.
 */

public class CommonScreenReceiver extends BroadcastReceiver {

    @Override
    public void onReceive(Context context, Intent intent) {
        if (Intent.ACTION_SCREEN_OFF.equals(intent.getAction())) {
            CommonMessageManager.getInstance().notify(CommonMessage.Type.SCREEN_OFF);
        } else if (Intent.ACTION_SCREEN_ON.equals(intent.getAction())) {
            CommonMessageManager.getInstance().notify(CommonMessage.Type.SCREEN_ON);
        }
    }

}
